home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
sc3x04.exe
/
CONNNUM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-10
|
3KB
|
78 lines
// IMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM;
// : :
// : module: connnum.c :
// : abstract: This module shows how to get the two-byte :
// : connection number by reading the shell's :
// : Connection ID Table. :
// : :
// : environment: NetWare 3.x v3.11 :
// : Borland C 3.1 :
// : :
// : This software is provided as is and carries no warranty :
// : whatsoever. Novell disclaims and excludes any and all implied :
// : warranties of merchantability, title and fitness for a particular :
// : purpose. Novell does not warrant that the software will satisfy :
// : your requirements or that the software is without defect or error :
// : or that operation of the software will be uninterrupted. You are :
// : using the software at your risk. The software is not a product :
// : of Novell, Inc. or any of subsidiaries. :
// HMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM<
//
// ****** N O T I C E ******
//
// This software is considered pre-release and may be used at your own
// risk and has been provided due to the many requests of our cust-
// omers. Support for this module will be provided at the sole
// discretion of Novell, Inc.
//
#include <stdio.h>
#include <string.h>
#include <dos.h>
#include "nwsys.h"
struct {
BYTE inUse;
BYTE order;
BYTE networkNumber[4];
BYTE networkNode[6];
WORD socket;
WORD receiveTimeOut;
BYTE routerNode[6];
BYTE packetSequence;
BYTE connectionNumber;
BYTE connectionStatus;
WORD maximumTimeOut;
WORD connectionWord;
BYTE majorServerVersion;
BYTE serverFlags; // Low order bit is set if burst mode enabled.
BYTE minorServerVersion;
} far *connIDTable;
#define ID 0
int main()
{
union REGS regs;
struct SREGS sregs;
int version;
memset(®s, 0, sizeof(union REGS));
segread(&sregs);
regs.h.ah = 0xef;
regs.h.al = 0x03;
intdosx(®s, ®s, &sregs);
if (regs.h.al != 0) {
printf("Get Connection ID call failed. Retcode = %d\n",
regs.h.al);
return(-1);
}
connIDTable = MK_FP(sregs.es, regs.x.si);
printf("Connection number word = %d\n", connIDTable[ID].connectionWord);
return(0);
}